<html>

<head>
  <title>誉优品学</title>
  <!--<link rel="stylesheet" href="css/common.css">-->
  <!--<script language="javascript" src="./js/CLodopFuncs.js"></script>-->
  <script language="javascript" src="./js/LodopFuncs.js"></script>
  <object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0>
    <embed id="LODOP_EM" type="application/x-print-lodop"  width=0 height=0 />
  </object>
  <style>
    .am-table {
      width: 100%;
      margin-bottom: 1.6rem;
      border-spacing: 0;
      border-collapse: separate
    }

    .am-table>tbody>tr>td,.am-table>tbody>tr>th,.am-table>tfoot>tr>td,.am-table>tfoot>tr>th,.am-table>thead>tr>td,.am-table>thead>tr>th {
      padding: .7rem;
      line-height: 1.6;
      vertical-align: bottom;
      border-top: 1px solid #ddd
    }

    .am-table>thead>tr>th {
      vertical-align: bottom;
      border-bottom: 1px solid #ddd
    }

    .am-table>caption+thead>tr:first-child>td,.am-table>caption+thead>tr:first-child>th,.am-table>colgroup+thead>tr:first-child>td,.am-table>colgroup+thead>tr:first-child>th,.am-table>thead:first-child>tr:first-child>td,.am-table>thead:first-child>tr:first-child>th {
      border-top: 0
    }

    .am-table>tbody+tbody tr:first-child td {
      border-top: 2px solid #ddd
    }

    .am-table-bordered {
      border: 1px solid #ddd;
      border-left: none
    }

    .am-table-bordered>tbody>tr>td,.am-table-bordered>tbody>tr>th,.am-table-bordered>tfoot>tr>td,.am-table-bordered>tfoot>tr>th,.am-table-bordered>thead>tr>td,.am-table-bordered>thead>tr>th {
      border-left: 1px solid #ddd
    }

    .am-table-bordered>tbody>tr:first-child>td,.am-table-bordered>tbody>tr:first-child>th {
      border-top: none
    }

    .am-table-bordered>thead+tbody>tr:first-child>td,.am-table-bordered>thead+tbody>tr:first-child>th {
      border-top: 1px solid #ddd
    }

    .am-table-radius {
      border: 1px solid #ddd;
      border-radius: 2px
    }

    .am-table-radius>thead>tr:first-child>td:first-child,.am-table-radius>thead>tr:first-child>th:first-child {
      border-top-left-radius: 2px;
      border-left: none
    }

    .am-table-radius>thead>tr:first-child>td:last-child,.am-table-radius>thead>tr:first-child>th:last-child {
      border-top-right-radius: 2px;
      border-right: none
    }

    .am-table-radius>tbody>tr>td:first-child,.am-table-radius>tbody>tr>th:first-child {
      border-left: none
    }

    .am-table-radius>tbody>tr>td:last-child,.am-table-radius>tbody>tr>th:last-child {
      border-right: none
    }

    .am-table-radius>tbody>tr:last-child>td,.am-table-radius>tbody>tr:last-child>th {
      border-bottom: none
    }

    .am-table-radius>tbody>tr:last-child>td:first-child,.am-table-radius>tbody>tr:last-child>th:first-child {
      border-bottom-left-radius: 2px
    }

    .am-table-radius>tbody>tr:last-child>td:last-child,.am-table-radius>tbody>tr:last-child>th:last-child {
      border-bottom-right-radius: 2px
    }


    .am-table-compact>tbody>tr>td,.am-table-compact>tbody>tr>th,.am-table-compact>tfoot>tr>td,.am-table-compact>tfoot>tr>th,.am-table-compact>thead>tr>td,.am-table-compact>thead>tr>th {
      padding: .4rem
    }

    .am-table-centered>tbody>tr>td,.am-table-centered>tbody>tr>th,.am-table-centered>tfoot>tr>td,.am-table-centered>tfoot>tr>th,.am-table-centered>thead>tr>td,.am-table-centered>thead>tr>th {
      text-align: center
    }

    .am-table>tbody>tr.am-disabled>td,.am-table>tbody>tr.am-disabled>th,.am-table>tbody>tr>td.am-disabled,.am-table>tbody>tr>th.am-disabled,.am-table>tfoot>tr.am-disabled>td,.am-table>tfoot>tr.am-disabled>th,.am-table>tfoot>tr>td.am-disabled,.am-table>tfoot>tr>th.am-disabled,.am-table>thead>tr.am-disabled>td,.am-table>thead>tr.am-disabled>th,.am-table>thead>tr>td.am-disabled,.am-table>thead>tr>th.am-disabled {
      color: #999
    }

    .am-table>tbody>tr.am-primary>td,.am-table>tbody>tr.am-primary>th,.am-table>tbody>tr>td.am-primary,.am-table>tbody>tr>th.am-primary,.am-table>tfoot>tr.am-primary>td,.am-table>tfoot>tr.am-primary>th,.am-table>tfoot>tr>td.am-primary,.am-table>tfoot>tr>th.am-primary,.am-table>thead>tr.am-primary>td,.am-table>thead>tr.am-primary>th,.am-table>thead>tr>td.am-primary,.am-table>thead>tr>th.am-primary {
      color: #0b76ac;
    }

    .am-table>tbody>tr.am-success>td,.am-table>tbody>tr.am-success>th,.am-table>tbody>tr>td.am-success,.am-table>tbody>tr>th.am-success,.am-table>tfoot>tr.am-success>td,.am-table>tfoot>tr.am-success>th,.am-table>tfoot>tr>td.am-success,.am-table>tfoot>tr>th.am-success,.am-table>thead>tr.am-success>td,.am-table>thead>tr.am-success>th,.am-table>thead>tr>td.am-success,.am-table>thead>tr>th.am-success {
      color: #5eb95e;
    }

    .am-table>tbody>tr.am-warning>td,.am-table>tbody>tr.am-warning>th,.am-table>tbody>tr>td.am-warning,.am-table>tbody>tr>th.am-warning,.am-table>tfoot>tr.am-warning>td,.am-table>tfoot>tr.am-warning>th,.am-table>tfoot>tr>td.am-warning,.am-table>tfoot>tr>th.am-warning,.am-table>thead>tr.am-warning>td,.am-table>thead>tr.am-warning>th,.am-table>thead>tr>td.am-warning,.am-table>thead>tr>th.am-warning {
      color: #F37B1D;
    }

    .am-table>tbody>tr.am-danger>td,.am-table>tbody>tr.am-danger>th,.am-table>tbody>tr>td.am-danger,.am-table>tbody>tr>th.am-danger,.am-table>tfoot>tr.am-danger>td,.am-table>tfoot>tr.am-danger>th,.am-table>tfoot>tr>td.am-danger,.am-table>tfoot>tr>th.am-danger,.am-table>thead>tr.am-danger>td,.am-table>thead>tr.am-danger>th,.am-table>thead>tr>td.am-danger,.am-table>thead>tr>th.am-danger {
      color: #dd514c;
    }
  </style>
</head>

<body style="font-size: 12px;">
<div id="main" style="font-size: 12px;padding: 20px;">
  <div style="text-align: center;font-size: 20px;margin-bottom: 22px;font-weight: bold">退费单</div>
  <form class="am-form tpl-form-border-form tpl-form-border-br" data-am-validator :id="id" onsubmit="return false ">
    <table style="font-size: 13px;    width: 750px;
    margin-bottom: 0;
    border-spacing: 0;
    border-collapse: separate;    border: 1px solid #ddd;" width="100%" class="am-table am-table-bordered am-table-compact am-table-striped am-text-nowrap">
      <tbody>
      <tr>
        <td style="text-align:center;font-weight: bold;width: 95px;height: 30px;">学生姓名</td>
        <td style="text-align:center;width: 95px;height: 30px;"><span id="studentName"></span></td>
        <td style="text-align:center;font-weight: bold;width: 95px;height: 30px;">学生学号</td>
        <td style="text-align:center;width: 95px;height: 30px;"><span id="studentNo"></span></td>
        <td style="text-align:center;font-weight: bold;width: 95px;height: 30px;">年级</td>
        <td style="text-align:center;width: 95px;height: 30px;"><span id="gradeName"></span></td>
        <td style="text-align:center;font-weight: bold;width: 95px;height: 30px;">就读学校</td>
        <td style="text-align:center;width: 95px;height: 30px;"><span id="school"></span></td>
      </tr>
      <tr>
        <td style="text-align:center;font-weight: bold">电话</td>
        <td style="text-align:center;"><span id="phoneNo"></span></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
      </tr>
      <tr>
        <td style="text-align:center;width: 95px;height: 30px;"></td>
        <td style="text-align:center;width: 95px;height: 30px;"></td>
        <td style="text-align:center;width: 95px;height: 30px;"></td>
        <td style="text-align:center;width: 95px;height: 30px;"></td>
        <td style="text-align:center;width: 95px;height: 30px;"></td>
        <td style="text-align:center;width: 95px;height: 30px;"></td>
        <td style="text-align:center;width: 95px;height: 30px;"></td>
        <td style="text-align:center;width: 95px;height: 30px;"></td>
      </tr>
      <tr>
        <td style="text-align:center;font-weight: bold;width: 95px;height: 30px;">报读期数</td>
        <td style="text-align:center;width: 95px;height: 30px;"><span id="periodName"></span></td>
        <td style="text-align:center;font-weight: bold;width: 95px;height: 30px;">报名校区</td>
        <td style="text-align:center;width: 95px;height: 30px;"><span id="campusName2"></span></td>
        <td style="text-align:center;font-weight: bold;width: 95px;height: 30px;">年级</td>
        <td style="text-align:center;width: 95px;height: 30px;"><span id="gradeName2"></span></td>
        <td style="text-align:center;font-weight: bold;width: 95px;height: 30px;">报读班级</td>
        <td style="text-align:center;width: 95px;height: 30px;"><span id="className"></span></td>
      </tr>
      <tr>
        <td style="text-align:center;font-weight: bold;width: 95px;height: 30px;">课程总讲次</td>
        <td style="text-align:center;width: 95px;height: 30px;"><span id="lectureAmount"></span></td>
        <td style="text-align:center;font-weight: bold;width: 95px;height: 30px;">报读总讲次</td>
        <td style="text-align:center;width: 95px;height: 30px;"><span id="refundLecture"></span></td>
        <td style="text-align:center;font-weight: bold;width: 95px;height: 30px;">退费起初讲次</td>
        <td style="text-align:center;width: 95px;height: 30px;"><span id="startAmount"></span></td>
        <td style="text-align:center;font-weight: bold;width: 95px;height: 30px;">结束讲次</td>
        <td style="text-align:center;width: 95px;height: 30px;"><span id="endAmount"></span></td>
      </tr>
      <tr>
        <td style="text-align:center;font-weight: bold;width: 95px;height: 30px;">已上讲次</td>
        <td style="text-align:center;width: 95px;height: 30px;"><span id="completedLectureAmount"></span></td>
        <td style="text-align:center;font-weight: bold;width: 95px;height: 30px;">整期金额</td>
        <td style="text-align:center;width: 95px;height: 30px;"><span id="studyingFee"></span></td>
        <td style="text-align:center;font-weight: bold;width: 95px;height: 30px;">实收金额</td>
        <td style="text-align:center;width: 95px;height: 30px;"><span id="payAmount"></span></td>
        <td style="text-align:center;font-weight: bold;width: 95px;height: 30px;">实退金额</td>
        <td style="text-align:center;width: 95px;height: 30px;"><span id="amount"></span></td>
      </tr>
      </tbody>
    </table>
    <table style="font-size: 13px;    width: 750px;
    margin-bottom: 0;
    border-spacing: 0;
    border-collapse: separate;    border: 1px solid #ddd;" width="100%" class="am-table am-table-bordered am-table-compact">
      <tbody>
      <tr>
        <td style="width: 60px;height: 60px" >发票</td>
        <td>
          <div>
            <div style="">原发票金额：</div>
            <div style="">原发票编号：</div>
            <div style="">原发票号码：</div>
            <div style="">重开发票金额：</div>
            <div style="">重开发票编号：</div>
            <div style="">重开发票号码：</div>
          </div>
        </td>
      </tr>
      <tr>
        <td></td>
        <td style="text-align: center">申请退费日期：<span id="createTime2"></span></td>
      </tr>
      </tbody>
    </table>
    <table style="font-size: 13px;    width: 750px;
    margin-bottom: 0;
    border-spacing: 0;
    border-collapse: separate;    border: 1px solid #ddd;" width="100%" class="am-table am-table-bordered am-table-compact">
      <tbody>
      <tr>
        <td style="width: 160px;height: 60px" >申请退费原因</td>
        <td>
          <div>
            <div style="width: 30%;  display: inline-block;float: left"><span id="reasonRemark"></span></div>
            <div style="width: 30%;  display: inline-block;float: left">申请人签名：<span id="applyOperator"></span></div>
            <div style="width: 30%;  display: inline-block;float: left">日期：<span id="createTime"></span></div>
          </div>
        </td>
      </tr>
      <tr>
        <td style="width: 160px;height: 60px">负责人审批</td>
        <td>
          <div>
            <div style="width: 30%;  display: inline-block;float: left"><span id="returnResult"></span></div>
            <div style="width: 30%;  display: inline-block;float: left">负责人签名：<span id="auditOperator"></span></div>
            <div style="width: 30%;  display: inline-block;float: left">日期：<span id="updateTime"></span></div>
          </div>
        </td>
      </tr>
      <tr>
        <td style="width: 160px;height: 60px">退费账户信息及金额</td>
        <td class="info">
          <div><span style="display: inline-block;  width: 149px;">姓名：</span><span id="cardUser"></span></div>
          <div><span style="display: inline-block;  width: 149px;">开户银行：</span><span id="bankName"></span></div>
          <div><span style="display: inline-block;  width: 149px;">开户账号：</span><span id="cardNo"></span></div>
          <div><span style="display: inline-block;  width: 149px;">退费金额（单位：元）</span><span id="amount2"></span></div>
          <div><span style="display: inline-block;  width: 149px;">大写：人民币 </span><span id="bigAmount"></span></div>
        </td>
      </tr>
      </tbody>
    </table>
    <div>
      <div style="text-align: center;margin: 18px;font-weight: bold">退费申请受理回执</div>
      <p>1. 您提交的退费资料已收悉，本次收取的资料仅作退费使用，不作其他用途。</p>
      <p>2. 退费金额（小写）：¥ <span id="amount3"></span>元，该退费金额预计于您提交资料之日起10个工作日到账，若您仍有疑问，请与受理校区咨询。</p>
      <div style="margin-left: 550px;margin-top: 20px;">受理校区：<span id="acceptCampusName"></span></div>
      <div style="margin-left: 550px;margin-top: 20px;">受理日期：<span id="createTime3"></span></div>
    </div>
  </form>
</div>
<!-- <script src="http://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script> -->
<!-- <script src="https://code.jquery.com/jquery-3.0.0.min.js"></script> -->
<script src="./js/jquery-3.0.0.min.js"></script>
<script>
  var LODOP
  $(function () {
    console.log('reload')
    var data = JSON.parse(sessionStorage.getItem('refundDetail'))
    console.log('data===', data)
    var studentName = data.student.name
    studentNo = data.student.studentNo
    gradeName = data.student.gradeName
    school = data.student.school
    phoneNo = data.student.phoneNo
    amount = data.studentRefund.amount
    gradeName2 = data.courseClass.gradeName
    bigAmount = digitUppercase(data.studentRefund.amount)
    operatorName = data.studentRefund.operatorName
    auditOperator = data.studentRefund.auditOperator
    createTime = data.studentRefund.createTime
    updateTime = data.studentRefund.updateTime
    reasonRemark = data.studentRefund.description
    auditName = data.studentRefund.auditName
    auditTime = data.studentRefund.auditTime
    cardUser = data.studentRefund.cardUser
    bankName = data.studentRefund.bankName
    cardNo = data.studentRefund.cardNo
    applyOperator = data.studentRefund.applyOperator
    className = data.studentRefund.className
    status = data.studentRefund.status
    payStatus = data.studentRefund.payStatus
    refundWay = data.studentRefund.refundWay
    refundLecture = parseInt( data.studentReg.initEndAmount ) - parseInt( data.studentReg.initStartAmount) + 1
    returnResult = data.studentRefund.returnResult || '&nbsp;'
    lectureAmount = data.courseClass.lectureAmount
    completedLectureAmount = data.courseClass.completedLectureAmount +'/'+data.courseClass.lectureAmount
    subjectName = data.courseClass.subjectName
    teacherName = data.courseClass.teacherName
    studyingFee = data.courseClass.studyingFee
    periodName = data.courseClass.periodName
    campusName = data.courseClass.campusName
    operator = data.studentReg.operator
    payAmount = data.studentReg.payAmount
    var refundLectures = data.studentRefund.refundLecture.split(',')
    totalAmount = data.studentReg.totalAmount
    startAmount = refundLectures[0]
    endAmount = refundLectures[refundLectures.length - 1 ]
    refundStatus = data.studentReg.refundStatus
    if (status === '0') {
      status = '审核中'
      updateTime = ''
    } else if (status === '1') {
      status = '同意'
    } else if (status === '2') {
      status = '拒绝'
    }

    $('#returnResult').html(returnResult)
    $('#updateTime').html(updateTime)
    $('#updateTime2').html(updateTime)
    $('#payAmount').html(payAmount)
    $('#refundStatus').html(refundStatus)
    $('#auditOperator').html(auditOperator)
    $('#applyOperator').html(applyOperator)
    $('#className').html(className)
    $('#periodName').html(periodName)
    $('#campusName').html(campusName)
    $('#campusName2').html(campusName)
    $('#operator').html(operator)
    $('#completedLectureAmount').html(completedLectureAmount)
    $('#refundLecture').html(refundLecture)
    $('#lectureAmount').html(lectureAmount)
    $('#status').html(status)
    $('#studentName').html(studentName)
    $('#studentNo').html(studentNo)
    $('#gradeName').html(gradeName)
    $('#gradeName2').html(gradeName2)
    $('#school').html(school)
    $('#phoneNo').html(phoneNo)
    $('#amount').html(amount)
    $('#auditName').html(auditName)
    $('#createTime').html(createTime)
    $('#createTime2').html(createTime)
    $('#createTime3').html(createTime)
    $('#reasonRemark').html(reasonRemark)
    $('#operatorName').html(operatorName)
    $('#auditTime').html(auditTime)
    $('#cardUser').html(cardUser)
    $('#bankName').html(bankName)
    $('#cardNo').html(cardNo)
    $('#amount2').html(amount)
    $('#bigAmount').html(bigAmount)
    $('#amount3').html(amount)
    $('#acceptCampusName').html(campusName)
    $('#auditTime2').html(auditTime)
    $('#startAmount').html(startAmount)
    $('#endAmount').html(endAmount)
    $('#studyingFee').html(studyingFee)
    CheckIsInstall()
  })
  function CheckIsInstall() {
    try{
      var LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM'));
      if (LODOP.VERSION) {
        if (LODOP.CVERSION)
          console.log("当前有C-Lodop云打印可用!\n C-Lodop版本:"+LODOP.CVERSION+"(内含Lodop"+LODOP.VERSION+")");
        else
          console.log("本机已成功安装了Lodop控件！\n 版本号:"+LODOP.VERSION);

      };
    }catch(err){
    }
  };

  //      https://gist.github.com/tonyc726/00c829a54a40cf80409f 数字金额大写转换
  function digitUppercase (n) {
    var fraction = ['角', '分'];
    var digit = [
      '零', '壹', '贰', '叁', '肆',
      '伍', '陆', '柒', '捌', '玖'
    ];
    var unit = [
      ['元', '万', '亿'],
      ['', '拾', '佰', '仟']
    ];
    var head = n < 0 ? '欠' : '';
    n = Math.abs(n);
    var s = '';
    for (var i = 0; i < fraction.length; i++) {
      s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
    }
    s = s || '整';
    n = Math.floor(n);
    for (var i = 0; i < unit[0].length && n > 0; i++) {
      var p = '';
      for (var j = 0; j < unit[1].length && n > 0; j++) {
        p = digit[n % 10] + unit[1][j] + p;
        n = Math.floor(n / 10);
      }
      s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
    }
    return head + s.replace(/(零.)*零元/, '元')
      .replace(/(零.)+/g, '零')
      .replace(/^整$/, '零元整');
  };

  function print() {
    CreatePrintPage()
    LODOP.PRINT();
  }

  function CreatePrintPage() {
    LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM'));
    LODOP.ADD_PRINT_HTM(0,0,"100%","100%",document.documentElement.innerHTML);
    LODOP.PREVIEW();
  };
</script>


</body>

</html>
